<%--
  Created by IntelliJ IDEA.
  User: 但何非
  Date: 2022/12/13
  Time: 20:41
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title>统计信息</title>
    <meta name="renderer" content="webkit" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0" />
    <link rel="stylesheet" href="../../static/lib/layui/css/layui.css" media="all" />
    <link rel="stylesheet" href="../../static/css/admin.css" media="all" />
</head>
<body>

<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
    <legend>支付宝商户配置信息</legend>
</fieldset>

<div class="layui-form">
    <table class="layui-table">
        <colgroup>
            <col width="150">
            <col width="150">
            <col width="150">
            <col width="150">
            <col width="150">
            <col width="150">
            <col width="150">
            <col width="150">
            <col width="150">
            <col>
        </colgroup>
        <thead>
        <tr>
            <th>id</th>
            <th>appid</th>
            <th>名称</th>
            <th>充值最小百分比</th>
            <th>充值最大百分比</th>
            <th>提现最小百分比</th>
            <th>提现最大百分比</th>
            <th>状态</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody id="html">
        </tbody>
    </table>
</div>


<%@ include file="/WEB-INF/view/common/includ-js.jsp" %>
<!-- Data Tables -->
<script src="${path}/static/Hui/js/plugins/dataTables/jquery.dataTables.js"></script>
<script src="${path}/static/Hui/js/plugins/dataTables/dataTables.bootstrap.js"></script>
<script src="${path}/static/plugins/layui/layui.all.js"></script>
<script>
    function info(){
        $.ajax({
            type:"post",
            url:"${path}/ali/config/list",
            dataType:"json",
            data: {},
            success:function(data){
                if(data.code == 0){
                    var html = "";
                    for (var i=0;i<data.data.length; i++){
                        html += "<tr><th>"+data.data[i].id+"</th>";
                        html += "<th>"+data.data[i].appId+"</th>";
                        html += "<th>"+data.data[i].name+"</th>";
                        html += "<th>"+data.data[i].minPercentage+"</th>";
                        html += "<th>"+data.data[i].maxPercentage+"</th>";
                        html += "<th>"+data.data[i].minWithPercentage+"</th>";
                        html += "<th>"+data.data[i].maxWithPercentage+"</th>";
                        if(data.data[i].status==2)
                            html += "<th>启用</th>";
                        else
                            html += "<th>禁用</th>";
                        html += "<th><a style='color: #337ab7;' href='/ali/config/update/index?id="+data.data[i].id+"'>修改</a></th>";
                        html += "</tr>";
                    }
                    $("#html").html(html);
                }else{
                    layer.alert(data.msg, {icon: 2});
                }
            }
        });
    }
    info();
</script>
</body>
</html>
